#ifndef _JOBS_H
#define _JOBS_H 1

#define OPT_FLG_WS      (0x01<<0)
#define OPT_FLG_DE      (0x01<<1)
#define OPT_FLG_TT      (0x01<<2)
#define OPT_FLG_RC      (0x01<<3)
#define OPT_FLG_REC     (0x01<<4)
#define OPT_FLG_REC_WS  (0x01<<5)
#define OPT_FLG_REC_JN  (0x01<<6)
#define OPT_FLG_REC_AP  (0x01<<7)
#define TBL_TWS_JOB     "tws_jobs"
#define DEFAULTWS       "CPLITA22"
#define MAX_LEN_WS      40
#define MAX_LEN_JN      40
#define MAX_LEN_JF      4096
#define MAX_LEN_SL      47
#define MAX_LEN_DE      120
#define MAX_LEN_TT      8
#define MAX_LEN_RC      256
#define MAX_LEN_REC_AC  9
#define MAX_LEN_REC_WS  40
#define MAX_LEN_REC_JN  40
#define MAX_LEN_REC_AP  64
#define PRINT_FMT_TXT1  1
#define PRINT_FMT_TXT2  2
#define PRINT_FMT_TXT3  3
#define PRINT_FMT_SQL1  4
#define PRINT_FMT_SQL2  5
#define PRINT_FMT_CSV1  6
#define PRINT_FMT_XML1  7
#define DEFAULT_PRINT_FMT       PRINT_FMT_TXT1

struct __tws_job {
    unsigned int option;
    char *workstation;
    char *jobname;
    char jobfiletype; /* Script (S) OR DoCommand (D) */
    char *jobfile; /* Script Name OR DoCommand */
    char *streamlogon;
    char *description;
    char *tasktype;
    char interactive;
    char *rccondsucc;
    struct {
        char *action;
        char *after_workstation;
        char *after_jobname;
        char *abendprompt;
    } recovery;
};
typedef struct __tws_job TWSJob;

void init_job(void);
void reset_job(void);
void print_job(void);
void destroy_job(void);
void print_xml_header(void);
void print_xml_footer(void);

#endif /* _JOBS_H */

